﻿using System;
using System.Collections.Generic;
using Orchard.UI.Navigation;
using SchoolPointe.Menus.ViewModels;
using SchoolPointe.Menus.Models;

namespace SchoolPointe.Menus.Services
{
    internal class NavigationProvider : INavigationProvider
    {
        private readonly BetterMenuPart _menu;
        private readonly Action<NavigationBuilder, BetterMenuPart> _getNavigation;

        public NavigationProvider(BetterMenuPart menu, Action<NavigationBuilder, BetterMenuPart> getNavigation)
        {
            _menu = menu;
            _getNavigation = getNavigation;
        }

        public string MenuName
        {
            get { return "BetterMenu." + this._menu.Id.ToString(); }
        }

        public void GetNavigation(NavigationBuilder builder)
        {
            _getNavigation(builder, _menu);
        }
    }
}